﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace OnlineCourse.Model.Entity
{
    /// <summary>
    /// 章节
    /// </summary>
    public class Section
    {
        public Section() {
            this.CreateDate = DateTime.Now;
            this.UpdateDate = DateTime.Now;
        }

        public Guid Id { get; set; }
        /// <summary>
        /// 课程ID
        /// </summary>
        public Guid CourseId { get; set; }
        public Course Course { get; set; }
        /// <summary>
        /// 章节名称
        /// </summary>
        [MaxLength(150)]
        public string Title { get; set; }
        /// <summary>
        /// 章节内容类型（1视频，2音频）
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// 音视频路径
        /// </summary>
        [MaxLength(200)]
        public string Path { get; set; } 
        /// <summary>
        /// 课程说明、详情
        /// </summary>
        [DataType(DataType.Text)]
        public string Detailed { get; set; }
        /// <summary>
        /// 是否支持试读
        /// </summary>
        public bool TryReading { get; set; }

        public DateTime CreateDate { get; set; }
        public DateTime UpdateDate { get; set; }
        /// <summary>
        /// 回复集合
        /// </summary>
        public ICollection<Comment> Comments { get; set; }
    }
}
